package cn.bluemobi.app.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.bluemobi.app.core.mybatis.PageUtils;
import cn.bluemobi.app.entity.output.BusinessRewardDetail;
import cn.bluemobi.app.entity.output.PointsDetail;
import cn.bluemobi.app.mapper.DetailMapper;
import cn.bluemobi.app.service.DetailService;
import cn.bluemobi.common.core.dto.Page;

/**
 * 
 * @author lvxh
 * 
 */
@Service
@Transactional
public class DetailServiceImpl implements DetailService {

	@Autowired
	private DetailMapper detailMapper;

	@Override
	public Page<PointsDetail> findPointsDetailList(Integer pageNo,
			Integer pageSize, String memberId) {
		Page<PointsDetail> page = PageUtils.startPage(pageNo, pageSize);
		Map<String, Object> params = new HashMap<String, Object>();
		params.put("memberId", memberId);
		List<PointsDetail> pointsDetailList = detailMapper
				.findPointsDetailList(params);
		page.setList(pointsDetailList);
		return page;
	}

	@Override
	public Page<BusinessRewardDetail> findBusinessRewardDetailList(
			Integer pageNo, Integer pageSize, String memberId) {
		Page<BusinessRewardDetail> page = PageUtils.startPage(pageNo, pageSize);
		Map<String, Object> params = new HashMap<String, Object>();
		params.put("memberId", memberId);
		List<BusinessRewardDetail> businessRewardDetailList = detailMapper
				.findBusinessRewardDetailList(params);
		page.setList(businessRewardDetailList);
		return page;
	}

}
